From f336d52be4d05c3de49d84cddfd7356605f5ba21 Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Sun, 28 Nov 2004 12:21:16 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.469 (41a9c2bcqd7AcyR2IqZKFxYUW-XVPg) domain.c: Check iopl when booting additional cpus. smpboot.c: Set iopl when booting additional cpus. --- linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c | 2 +- xen/arch/x86/domain.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c index 4eef120ba8..5e2e798628 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c @@ -880,7 +880,7 @@ static int __init do_boot_cpu(int apicid) ctxt.cpu_ctxt.cs = __KERNEL_CS; ctxt.cpu_ctxt.eip = start_eip; ctxt.cpu_ctxt.esp = idle->thread.esp; - ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2); + ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2) | (idle->thread.io_pl<<12); /* FPU is set up to default initial state. */ memset(ctxt.fpu_ctxt, 0, sizeof(ctxt.fpu_ctxt)); diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 5e6042f50c..a459c50fcd 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -248,6 +248,10 @@ int arch_final_setup_guestos(struct exec_domain *d, full_execution_context_t *c) &c->cpu_ctxt, sizeof(d->thread.user_ctxt)); + /* Clear IOPL for unprivileged domains. */ + if (!IS_PRIV(d->domain)) + d->thread.user_ctxt.eflags &= 0xffffcfff; + /* * This is sufficient! If the descriptor DPL differs from CS RPL then we'll * #GP. If DS, ES, FS, GS are DPL 0 then they'll be cleared automatically. -- 2.30.2